﻿#region

using System.Collections.Generic;
using BusinessObjects;
using DataAccessLayer;

#endregion

namespace BusinessLogicLayer
{
    public static class SupervisorBLL
    {
        /// <summary>
        ///     Register a supervisor
        /// </summary>
        /// <param name="staffId">Represent's the staff Id</param>
        /// <param name="supervisorType">Represent's the supervisor type</param>
        public static void RegisterSupervisor(int staffId, string supervisorType)
        {
            var supervisor = new Supervisor
            {
                StaffId = staffId,
                SupervisorType = supervisorType
            };

            SupervisorDAL.RegisterSupervisor(supervisor);
        }

        /// <summary>
        ///     Get All supervisors
        /// </summary>
        /// <returns>All supervisors</returns>
        public static List<Supervisor> GetAllSupervisors()
        {
            return SupervisorDAL.GetAllSupervisors();
        }

        /// <summary>
        ///     Get supervisor type by id
        /// </summary>
        /// <param name="staffId">Represent's the staff id</param>
        /// <returns>Supervisor type</returns>
        public static string GetSupervisorTypeById(int staffId)
        {
            return SupervisorDAL.GetSupervisorTypeById(staffId);
        }

        /// <summary>
        ///     Edit supervisor's details
        /// </summary>
        /// <param name="staffId">Represent's the staff Id</param>
        /// <param name="supervisorType">Represent's the supervisor type</param>
        public static void EditSupervisor(int staffId, string supervisorType)
        {
            var supervisor = new Supervisor
            {
                StaffId = staffId,
                SupervisorType = supervisorType
            };

            SupervisorDAL.EditSupervisor(supervisor);
        }

        /// <summary>
        ///     Get All supervisors by subsidiary id and supervisor type
        /// </summary>
        /// <param name="subsidiaryId">Represent's the subsidiary id</param>
        /// <param name="supervisorType">Represent's the supervisor type</param>
        /// <returns>All supervisors</returns>
        public static List<Supervisor> GetAllSupervisors(byte subsidiaryId, string supervisorType)
        {
            return SupervisorDAL.GetAllSupervisors(subsidiaryId, supervisorType);
        }
    }
}